var e = require;
var t = module;
var o = exports;
var n,
    i = o,
    a =
        ((n = function (e, t) {
            return (n =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (e, t) {
                        e.__proto__ = t;
                    }) ||
                function (e, t) {
                    for (var o in t) t.hasOwnProperty(o) && (e[o] = t[o]);
                })(e, t);
        }),
        function (e, t) {
            function o() {
                this.constructor = e;
            }
            n(e, t), (e.prototype = null === t ? Object.create(t) : ((o.prototype = t.prototype), new o()));
        }),
    r = function (e, t, o, n) {
        var i,
            a = arguments.length,
            r = a < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, o, n);
        else
            for (var s = e.length - 1; s >= 0; s--)
                (i = e[s]) && (r = (a < 3 ? i(r) : a > 3 ? i(t, o, r) : i(t, o)) || r);
        return a > 3 && r && Object.defineProperty(t, o, r), r;
    };
Object.defineProperty(i, "__esModule", {value: !0});
var s = e("Util"),
    c = e("GameData"),
    l = cc._decorator,
    d = l.ccclass,
    u =
        (l.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (t.mapSize = 5e3), (t.bg_image = null), (t.mask = null), t;
            }
            var o;
            return (
                a(t, e),
                (o = t),
                (t.prototype.onLoad = function () {
                    var e = this;
                    if (c.default.instance.GameModel != c.GameModel.eatChicken) return (this.node.active = !1);
                    (this.mask = this.node.getChildByName("mask")),
                        (this.mapSize = this.mask.width),
                        (this.bg_image = this.mask.getChildByName("mask").getChildByName("bg_image")),
                        this.scheduleOnce(function () {
                            e.playAct(5e3);
                        }, 30),
                        this.scheduleOnce(function () {
                            e.playAct(3e3);
                        }, 60),
                        this.scheduleOnce(function () {
                            e.playAct(1e3, cc.v3(s.default.randomFrom(-500, 500), s.default.randomFrom(-500, 500), 0));
                        }, 90);
                }),
                (t.prototype.playAct = function (e, t) {
                    void 0 === t && (t = cc.v3(0, 0, 0));
                    var n = this;
                    cc
                        .tween(this.node.getComponent(o))
                        .to(
                            5,
                            {mapSize: e},
                            {
                                progress: function (e, t, o, i) {
                                    var a = e + (t - e) * i;
                                    return (n.mask.width = n.mapSize), (n.mask.height = n.mapSize), a;
                                }
                            }
                        )
                        .start(),
                        t != cc.v3(0, 0, 0) && cc.tween(this.mask).to(5, {position: t}).start();
                }),
                (t.prototype.onDestroy = function () {
                    c.default.instance.GameModel == c.GameModel.eatChicken && this.unscheduleAllCallbacks();
                }),
                (o = r([d], t))
            );
        })(cc.Component));
i.default = u;
